package com.guigu.abo.controllers.admin;

import com.guigu.abo.pojo.ReSpeciality;
import com.guigu.abo.service.ReSpecialityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class AdminControllers {

    @Autowired
    ReSpecialityService reSpecialityService;

    @GetMapping("/Login")
    public String login(){
        return "adminjsp/login";
    }

    @GetMapping("/LoginOk")
    public String go(String admin,String password){
        if ("admin".equals(admin) && "admin".equals(password)){
            return "adminjsp/adminIndex";
        }
        return "redirect:/Login";
    }

    /*转发到页面*/
    /*显示去个人信息页面*/
    @GetMapping("/GoUserInfo")
    public String go2(){

        return "adminjsp/showUserInfo";
    }
    /*查询技能信息并跳转到页面*/
    @GetMapping("/GoInfo")
    public String go3(Model model){
        List<ReSpeciality> reSpecialities = reSpecialityService.selectAll();
        model.addAttribute("reSpecialities",reSpecialities);
        return "adminjsp/showSpeciality";
    }
    @GetMapping("/GoInfo3")
    public String go4(){

        return "adminjsp/c";
    }
    @GetMapping("/GoInfo4")
    public String go5(){

        return "adminjsp/d";
    }

}

